package com.zl.bcyappserver.utils;

/**
 * Created by ZhongLeiDev at 2019/12/5
 */
public class UserUtil {

    private String cookie;
    private static final String Extra = "tt_webid=6765672592922707470; Hm_lvt_330d168f9714e3aa16c5661e62c00232=1575255918,1575350791; SLARDAR_WEB_ID=cd3a2238-841b-4e08-b0c1-6e077f3ae418; lang_set=zh; _ga=GA1.2.734520056.1575263761; msh=36tNx_itQKzpF5GLXfBTVteDxk8; passport_auth_status=e3d3ca9ace75ac8ef9c00b53a30bc837%2C; sid_guard=e64f91b94ddd3984e4fbf4fed0d03d12%7C1575266305%7C5184000%7CFri%2C+31-Jan-2020+05%3A58%3A25+GMT; uid_tt=708b99c250828a189dce12014f8aa356; sid_tt=e64f91b94ddd3984e4fbf4fed0d03d12; sessionid=e64f91b94ddd3984e4fbf4fed0d03d12; main_sid=e8e9945d541b8d962ea745142ade2547; __tea_sdk__ssid=undefined;";

    private static UserUtil userUtil;

    private UserUtil() {
        cookie = "";
    }

    public static UserUtil getSingletonInstance() {
        if (userUtil == null) {
            userUtil = new UserUtil();
        }
        return userUtil;
    }

    public synchronized void setCookie(String ck) {
        if (!cookie.equals(ck)) {
            cookie = ck;
        }
    }

    public String getCookie() {
        return Extra + cookie;
    }

}
